#ifndef CONSTANT_EXPRESSION_NODE_H
#define CONSTANT_EXPRESSION_NODE_H

#include "ExpressionNode.h"
#include "Column.h"

template <typename T>
class ConstantExpressionNode: public ExpressionNode {
	public:
		ConstantExpressionNode(const T c):
				_c(c) {}

		virtual Column pull(const SharedArray<Column>& data) {
			assert(data.size() > 0);

			int size = data[0].size();
			SharedArray<T> constColumn(size);
			for (int i = 0; i < size; ++i) {
				constColumn[i] = _c;
			}

			return Column(constColumn);
		}

	private:
		const T _c;
};

#endif
